<?php
	
function mt_content_header($args){
    
    if (mt_is_home()){
    
    $block = Block::get(MtEnum::BLK_CONTENT_HEADER);
    
    if (mtEnum::BLK_NOT_FOUND == $block) return;
            
    $buff = _t('section', $block, array('class'=>'content-title'));
    t('div',$buff,array('id'=>'content-header'));
    
    
    } else {
        
        $date = Date::format(Pages::$page['date'], 'M d, Y');
        $buff = _t('h2',Site::title());
        $buff .= '<p>Posted on <em class="date">'.$date.'</em> by '.Page::author().'</p>';
        
        $buff = _t('section', $buff, array('class'=>'content-title'));
        t('div',$buff,array('id'=>'content-header'));
            
    }
    
    return $args;
}


function mt_footer_copyright(){
    
    $buff = 'Copyright &copy; '.date('Y').', ';
    $buff .= _t('a',MT_SITE_NAME,array('href'=>MT_BASE_URL,'class'=>'org site-name', 'title'=> MT_SITE_NAME)).' ';
    $buff .= 'All rights reserved. ';    
    $buff .= ' Theme design by <a href="http://menestystech.com">Nuar Haruha</a> ';
    $buff .= Site::powered();
    t('p',$buff, array('class'=>'copyright'));    
}

function mt_widget_twitter(){
    
    $uid = strtolower(MT_TWITTER_USERNAME);
    
    $url = 'http://twitter.com/';
    
    $el_id = 'twitter_update_list'; 
       
    $max_count = (define(MT_TWITTER_MAX_COUNT) ? MT_TWITTER_MAX_COUNT : 5 ); 
    
    $params = array('javascripts/blogger.js',
                'statuses/user_timeline/'.$uid.'.json?callback=twitterCallback2&amp;count='.$max_count);
    
    $buff = _t('a', '@'.$uid, array('href'=>$url.$uid));
    $buff = _t('h4','Twitter '.$buff, array('class'=>'widget-title'));
    
    $preloader = _t('img','',array('src'=>MT_IMG_URL.'loading.gif','alt'=>'twitter feed loading', 'width'=>220,'height'=>19));
    
    $buff .= _t('ul',_t('li',$preloader),array('id'=>$el_id,'class'=>'na'));
    
    foreach($params as $src) {
        $buff .= _t('script','',array('src'=>$url.$src,'type'=>'text/javascript'));
    }
    
    $buff = _t('div',$buff,array('class'=>'widget-wrap'));
                
    t('section',$buff, array('class'=>'twitter'));
}